<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>3 Upgrading 3.2.11</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
    <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
    <script type="text/javascript">
function addJsClass() {
    var classes = document.body.className.split(" ");
    classes.push("js");
    document.body.className = classes.join(" ");
}
    </script>
</head>

<body class="body" onload="addJsClass();">
<div id="navigation">
    <div class="navTitle">
        
        The Grails Framework
    </div>
    <div class="navLinks">
        <ul>
            <li>
                <div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
                    <a href="../guide/index.html" class="button">Table of contents</a>

                    <div id="nav-summary-childs" style="display:none;">
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/introduction.html"><strong>1</strong><span>Introduction</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/gettingStarted.html"><strong>2</strong><span>Getting Started</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/upgrading.html"><strong>3</strong><span>Upgrading</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/conf.html"><strong>4</strong><span>Configuration</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/commandLine.html"><strong>5</strong><span>The Command Line</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/profiles.html"><strong>6</strong><span>Application Profiles</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/GORM.html"><strong>7</strong><span>Object Relational Mapping (GORM)</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/theWebLayer.html"><strong>8</strong><span>The Web Layer</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/traits.html"><strong>9</strong><span>Traits</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/webServices.html"><strong>10</strong><span>Web Services</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/async.html"><strong>11</strong><span>Asynchronous Programming</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/validation.html"><strong>12</strong><span>Validation</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/services.html"><strong>13</strong><span>The Service Layer</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/staticTypeCheckingAndCompilation.html"><strong>14</strong><span>Static Type Checking And Compilation</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/testing.html"><strong>15</strong><span>Testing</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/i18n.html"><strong>16</strong><span>Internationalization</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/security.html"><strong>17</strong><span>Security</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/plugins.html"><strong>18</strong><span>Plugins</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/spring.html"><strong>19</strong><span>Grails and Spring</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/hibernate.html"><strong>20</strong><span>Grails and Hibernate</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/scaffolding.html"><strong>21</strong><span>Scaffolding</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/deployment.html"><strong>22</strong><span>Deployment</span></a>
                        </div>
                        
                        <div class="toc-item" style="margin-left:0"><a href="../guide/contributing.html"><strong>23</strong><span>Contributing to Grails</span></a>
                        </div>
                        
                    </div>
                </div>
            </li>
            <li class="separator selected">
                <a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
            </li>
        </ul>
    </div>


</div>

<table id="colset" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td id="col1">
            <div id="main" class="corner-all">

                
                    <div class="toc-item prev-left"><a href="../guide/gettingStarted.html">&lt;&lt; <strong>2</strong><span>Getting Started</span></a></div>
                

                <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>

                
                    <div class="toc-item next-right"><a href="../guide/conf.html"><strong>4</strong><span>Configuration</span> >></a></div>
                


                <div class="project">
                    <h1>3 Upgrading</h1>

                    <p><strong>Version:</strong> 3.2.11</p>
                </div>

                
                <div id="table-of-content">
                    <h2>Table of Contents</h2>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#upgrading32x"><strong>3.1</strong><span>Upgrading from Grails 3.2</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#upgrading31x"><strong>3.2</strong><span>Upgrading from Grails 3.1</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#upgrading3x"><strong>3.3</strong><span>Upgrading from Grails 3.0</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#upgrading2x"><strong>3.4</strong><span>Upgrading from Grails 2.x</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#upgradingPlugins"><strong>3.4.1</strong><span>Upgrading Plugins</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#upgradingApps"><strong>3.4.2</strong><span>Upgrading Applications</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#upgradingGeneral"><strong>3.4.3</strong><span>General Changes to be aware of when migrating apps</span></a>
                    </div>
                    
                </div>
                

                

<h1 id="upgrading">3 Upgrading</h1>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>Grails 3.0 is a complete ground up rewrite of Grails and introduces new concepts and components for many parts of the framework.</p>
</div>
<div class="paragraph">
<p>When upgrading an application or plugin from Grails 3.0 there are many areas to consider including:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Removal of dynamic scaffolding from Grails 3.0.0 till 3.0.4 when it was re-introduced</p>
</li>
<li>
<p>Removal of before and after interceptors</p>
</li>
<li>
<p>Project structure differences</p>
</li>
<li>
<p>File location differences</p>
</li>
<li>
<p>Configuration differences</p>
</li>
<li>
<p>Package name differences</p>
</li>
<li>
<p>Legacy Gant Scripts</p>
</li>
<li>
<p>Gradle Build System</p>
</li>
<li>
<p>Changes to Plugins</p>
</li>
<li>
<p>Source vs Binary Plugins</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The best approach to take when upgrading a plugin or application (and if your application is using several plugins the plugins will need upgrading first) is to create a new Grails 3.0 application of the same name and copy the source files into the correct locations in the new application.</p>
</div>
<div class="sect2">
<h3 id="_removal_of_before_and_after_interceptors">Removal of before and after interceptors</h3>
<div class="paragraph">
<p>Before and after interceptors were removed. So all <code>beforeInterceptor</code> and <code>afterInterceptor</code> need to be replaced by Stand alone interceptors.</p>
</div>
<div class="sect3">
<h4 id="_file_location_differences">File Location Differences</h4>
<div class="paragraph">
<p>The location of certain files have changed or been replaced with other files in Grails 3.0. The following table lists old default locations and their respective new locations:</p>
</div>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><strong>Old Location</strong></th>
<th class="tableblock halign-left valign-top"><strong>New Location</strong></th>
<th class="tableblock halign-left valign-top"><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/BuildConfig.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>build.gradle</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Build time configuration is now defined in a Gradle build file</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/Config.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/application.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Renamed for consistency with Spring Boot</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/UrlMappings.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/controllers/UrlMappings.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved since grails-app/conf is not a source directory anymore</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/BootStrap.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/init/BootStrap.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved since grails-app/conf is not a source directory anymore</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>scripts</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/main/scripts</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved for consistency with Gradle</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/main/groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved for consistency with Gradle</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/java</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/main/groovy</code> (yes, groovy!)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved for consistency with Gradle</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>test/unit</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/test/groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved for consistency with Gradle</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>test/integration</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/integration-test/groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved for consistency with Gradle</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>web-app</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/main/webapp</code> or <code>src/main/resources/</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Moved for consistency with Gradle</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>\*GrailsPlugin.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/main/groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The plugin descriptor moved to a source directory</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p><code>src/main/resources/public</code> is recommended as <code>src/main/webapp</code> only gets included in WAR packaging but not in JAR packaging.</p>
</div>
<div class="paragraph">
<p>It is recommended to merge Java source files from <code>src/java</code> into <code>src/main/groovy</code>. You can create a <code>src/main/java</code> directory if you want to and it will be used but it is generally better to combine the folders. (The Groovy and Java sources compile together.)</p>
</div>
<div class="paragraph">
<p>For plugins the plugin descriptor (a Groovy file ending with "GrailsPlugin") which was previously located in the root of the plugin directory should be moved to the <code>src/main/groovy</code> directory under an appropriate package.</p>
</div>
</div>
<div class="sect3">
<h4 id="_new_files_not_present_in_grails_2_x">New Files Not Present in Grails 2.x</h4>
<div class="paragraph">
<p>The reason it is best to create a new application and copy your original sources to it is because there are a number of new files that are not present in Grails 2.x by default. These include:</p>
</div>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><strong>File</strong></th>
<th class="tableblock halign-left valign-top"><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>build.gradle</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Gradle build descriptor located in the root of the project</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>gradle.properties</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Properties file defining the Grails and Gradle versions</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/logback.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Logging previously defined in <code>Config.groovy</code> is now defined using Logback</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/application.yml</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Configuration can now also be defined using YAML</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/init/PACKAGE_PATH/Application.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The <code>Application</code> class used By Spring Boot to start the application</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_files_not_present_in_grails_3_x">Files Not Present in Grails 3.x</h4>
<div class="paragraph">
<p>Some files that were previously created by Grails 2.x are no longer created. These have either been removed or an appropriate replacement added. The following table lists files no longer in use:</p>
</div>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><strong>File</strong></th>
<th class="tableblock halign-left valign-top"><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>application.properties</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The application version is now defined in <code>build.gradle</code>. The application name defaults to the directory name which can be overridden by creating a <code>settings.gradle</code> file and setting the <code>rootProject.name</code> property</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>grails-app/conf/DataSource.groovy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Merged together into <code>application.yml</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>lib</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Dependency resolution should be used to resolve JAR files</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>web-app/WEB-INF/applicationContext.xml</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Removed. Beans can be defined in <code>grails-app/conf/spring/resources.groovy</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>src/templates/war/web.xml</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Grails 3.0 no longer requires web.xml. Customizations can be done via Spring</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>web-app/WEB-INF/sitemesh.xml</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Removed. Sitemesh filter no longer present.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>web-app/WEB-INF/tld</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Removed. Can be restored in <code>src/main/webapp</code> or <code>src/main/resources/WEB-INF</code></p></td>
</tr>
</tbody>
</table>
</div>
</div>


<h2 id="upgrading32x">3.1 Upgrading from Grails 3.2</h2>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading/upgrading32x.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>If you are upgrading from Grails 3.2 there are a few items to take into consideration.</p>
</div>
<div class="sect3">
<h4 id="_legacy_converters_api_separated_from_core">Legacy Converters API Separated From Core</h4>
<div class="paragraph">
<p>Since the addition of json views, the previous way to convert objects to JSON has been considered legacy. In Grails 3.3 the code to support the legacy converters has been moved out of core and into a separate plugin. That means that by default, code that uses <code>grails.converters.JSON</code> or <code>grails.converters.XML</code> will no longer work by default.</p>
</div>
<div class="paragraph">
<p>Common usages of this feature are <code>render(book as JSON)</code>.</p>
</div>
<div class="paragraph">
<p>If your codebase uses the legacy converters it is encouraged to convert the functionality to use JSON views, however you can add a dependency in your code to allow current usages of the converters to work again.</p>
</div>
<div class="listingblock">
<div class="title">build.gradle</div>
<div class="content">
<pre>    compile "org.grails.plugins:grails-plugin-converters"</pre>
</div>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
The support to build JSON directly from the render method no longer supports the old API and any code that used it will need to be converted to use the <a href="http://docs.groovy-lang.org/latest/html/gapi/groovy/json/StreamingJsonBuilder.html">groovy.json.StreamingJsonBuilder</a> syntax.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The support for rendering with the previous API was disabled by default in 3.1 and was able be re-enabled with the <code>grails.json.legacy.builder: true</code> setting. That setting has been removed in Grails 3.3.</p>
</div>
</div>


<h2 id="upgrading31x">3.2 Upgrading from Grails 3.1</h2>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading/upgrading31x.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>If you are upgrading from Grails 3.1 there are a few items to take into consideration.</p>
</div>
<div class="sect3">
<h4 id="_use_webpromises_instead_of_promises_in_controllers">Use WebPromises instead of Promises in Controllers</h4>
<div class="paragraph">
<p>In versions of Grails prior to 3.2, <code>grails.async.Promises</code> used to allow the use of <code>render</code> and other controller methods, however this was unsafe as the request thread may have finished prior to the task executing leading to unexpected errors.</p>
</div>
<div class="paragraph">
<p>You should now instead use <code>grails.async.web.WebPromises</code> within a controller.</p>
</div>
</div>
<div class="sect3">
<h4 id="_deprecated_classes_and_methods_removed">Deprecated Classes and Methods Removed</h4>
<div class="paragraph">
<p>Classes and methods deprecated in Grails 3.0.x have been removed in Grails 3.2. This includes all classes in the <code>org.codehaus.groovy.grails</code> package. If your application or plugin uses deprecated classes they should be updated to use non-deprecated replacements.</p>
</div>
</div>
<div class="sect3">
<h4 id="_slf4j_now_default">Slf4j Now Default</h4>
<div class="paragraph">
<p>The <code>log</code> property injected at compile time into all classes is now an Slf4j <code>Logger</code> instance and not an instance of the Commons Logging <code>Log</code> class.</p>
</div>
<div class="paragraph">
<p>This should be a simple upgrade for most use cases, however this change does have some implications, for example it is no longer possible to pass non-string types to the log method. Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">log.info <span class="string"><span class="delimiter">&quot;</span><span class="content">this works</span><span class="delimiter">&quot;</span></span>
<span class="predefined-type">Double</span> notAString = <span class="float">9.2</span>
log.info notAString</code></pre>
</div>
</div>
<div class="paragraph">
<p>The latter call to the <code>info</code> method will throw an exception as it is not a String.</p>
</div>
<div class="paragraph">
<p>Instead you should use Slf4j&#8217;s formatting anchors to log. The advantage is the <code>toString()</code> method is not called unless the message will be logged.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">log.info <span class="string"><span class="delimiter">&quot;</span><span class="content">{}</span><span class="delimiter">&quot;</span></span>, <span class="float">9.2D</span>
log.debug <span class="string"><span class="delimiter">&quot;</span><span class="content">Key: {}, Value: {}</span><span class="delimiter">&quot;</span></span>, key, value
log.error <span class="string"><span class="delimiter">&quot;</span><span class="content">{}</span><span class="delimiter">&quot;</span></span>, exception.message, exception</code></pre>
</div>
</div>
<div class="paragraph">
<p>See the <a href="http://www.slf4j.org/faq.html#string_or_object">Slf4j FAQ</a> for more information.</p>
</div>
</div>
<div class="sect3">
<h4 id="_spring_4_3">Spring 4.3</h4>
<div class="paragraph">
<p>Grails 3.2 comes with Spring 4.3 which no longer supports Hibernate 3 and hence Grails 3.2 no longer supports Hibernate 3 either and you will need to upgrade to Hibernate 4 or above.</p>
</div>
</div>
<div class="sect3">
<h4 id="_spring_boot_1_4">Spring Boot 1.4</h4>
<div class="paragraph">
<p>Spring Boot 1.4, through its dependency management mechanism, enforces the upgrade for many dependencies. You should review your dependencies following the upgrade to ensure the new versions are compatible with your application.</p>
</div>
<div class="paragraph">
<p>Spring Boot 1.4 also deprecates many testing annotations (such as <code>WebIntegrationTest</code>).</p>
</div>
<div class="paragraph">
<p>See the <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.4-Release-Notes">Spring Boot 1.4 release notes</a> for more information on the changes required at the Boot level.</p>
</div>
</div>
<div class="sect3">
<h4 id="_hibernate_4_usage">Hibernate 4 Usage</h4>
<div class="paragraph">
<p>Related to Spring Boot 1.4, one important change is that Hibernate 5 is now the default version, so if you have declared a dependency on the <code>hibernate4</code> plugin in Grails such as:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">compile <span class="string"><span class="delimiter">&quot;</span><span class="content">org.grails.plugins:hibernate4</span><span class="delimiter">&quot;</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>This will not be enough to ensure that Hibernate 4 is used. You must instead also directly declare the Hibernate 4 dependencies:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">dependencies {
    compile <span class="string"><span class="delimiter">&quot;</span><span class="content">org.grails.plugins:hibernate4</span><span class="delimiter">&quot;</span></span>
    compile <span class="string"><span class="delimiter">&quot;</span><span class="content">org.hibernate:hibernate-core:4.3.10.Final</span><span class="delimiter">&quot;</span></span>
    compile <span class="string"><span class="delimiter">&quot;</span><span class="content">org.hibernate:hibernate-ehcache:4.3.10.Final</span><span class="delimiter">&quot;</span></span>
}</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_gorm_6_configuration_model">GORM 6 Configuration Model</h4>
<div class="paragraph">
<p>In preparation for Hibernate 5.2 support the previous "SessionFactoryBean" notion has been removed. Now if you wish to customize <code>SessionFactory</code> creation you should instead register a custom <code>org.grails.orm.hibernate.connections.HibernateConnectionSourceFactory</code> in Spring.</p>
</div>
</div>
<div class="sect3">
<h4 id="_hibernatetestmixin_dependency_changes">HibernateTestMixin Dependency Changes</h4>
<div class="paragraph">
<p>The <code>grails-datastore-test-support</code> dependency has been removed and the <code>HibernateTestMixin</code> class integrated directly into the plugin, so if you receive a resolve error remove the following dependency from your <code>build.gradle</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">dependencies {
    testImplementation <span class="string"><span class="delimiter">&quot;</span><span class="content">org.grails:grails-datastore-test-support</span><span class="delimiter">&quot;</span></span>
}</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="__code_application_groovy_code_changes"><code>application.groovy</code> Changes</h4>
<div class="paragraph">
<p>An improvement was added to make groovy configuration behave like yml configuration when it comes to the CLI. Previously, configuration values in <code>application.groovy</code> were not available to commands like <code>grails create-controller</code>. A side effect of this change causes an exception when those commands are executed if the configuration relies on classes in the runtime.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="exception">Error</span> occurred running Grails <span class="key">CLI</span>: startup <span class="key">failed</span>:
script14738267015581837265078.groovy: <span class="integer">13</span>: unable to resolve <span class="type">class</span> <span class="class">com</span>.foo.Bar</code></pre>
</div>
</div>
<div class="paragraph">
<p>The solution is to create a separate file called <code>runtime.groovy</code> in <code>grails-app/conf</code>. That file will not be parsed by the CLI and will only be included at runtime.</p>
</div>
</div>
<div class="sect3">
<h4 id="_stop_using_the_default_namespace">Stop using the default namespace</h4>
<div class="paragraph">
<p>Using the default package in places like <code>UrlMappings.groovy</code>, <code>BootStrap.groovy</code> or in a taglib can cause that code to fail or not execute at all when packaged in a JAR or WAR file. Make sure all Groovy/Java files start with the <code>package</code> statement and move any affected files to the respective folder. For example, change:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="type">class</span> <span class="class">UrlMappings</span> {

    <span class="directive">static</span> mappings = {

    ...</code></pre>
</div>
</div>
<div class="paragraph">
<p>to:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="keyword">package</span> myapp

<span class="type">class</span> <span class="class">UrlMappings</span> {

    <span class="directive">static</span> mappings = {

    ...</code></pre>
</div>
</div>
<div class="paragraph">
<p>and move the file from <code>grails-app/controllers/UrlMappings.groovy</code> into <code>.grails-app/controllers/myapp/UrlMappings.groovy</code></p>
</div>
</div>


<h2 id="upgrading3x">3.3 Upgrading from Grails 3.0</h2>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading/upgrading3x.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>Generally to upgrade an application from Grails 3.0 you can simply modify the version of Grails in <code>gradle.properties</code>.</p>
</div>
<div class="paragraph">
<p>There are however some differences to Grails 3.0.x that are documented below.</p>
</div>
<div class="sect3">
<h4 id="_gorm_5_upgrade">GORM 5 Upgrade</h4>
<div class="paragraph">
<p>Grails 3.1 ships with GORM 5, which is a near complete rewrite of GORM ontop of Groovy traits and is not binary compatible with the previous version of GORM.</p>
</div>
<div class="paragraph">
<p>If you receive an error such as:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">Caused <span class="key">by</span>: java.lang.ClassNotFoundException: org.grails.datastore.gorm.GormEntity<span class="error">$</span>Trait<span class="error">$</span>FieldHelper
    ... <span class="integer">8</span> more</code></pre>
</div>
</div>
<div class="paragraph">
<p>You are using a plugin or class that was compiled with a previous version of GORM and these will need to be recompiled to be Grails 3.1 and GORM 5 compatible.</p>
</div>
</div>
<div class="sect3">
<h4 id="_hibernate_plugin">Hibernate Plugin</h4>
<div class="paragraph">
<p>For the GORM 5 release the <code>hibernate</code> plugin has been renamed to <code>hibernate4</code> (and there are <code>hibernate3</code> and <code>hibernate5</code> versions too). You should change your <code>build.gradle</code> to reflect that:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">compile <span class="string"><span class="delimiter">'</span><span class="content">org.grails.plugins:hibernate4</span><span class="delimiter">'</span></span></code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_static_resources_path">Static Resources Path</h4>
<div class="paragraph">
<p>The default path for static resources resolved from <code>src/main/resources/public</code> has been changed to be nested under the <code>static/*</code> pattern instead of directly under the root of the application. For example a link in GSP pages such as:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="error">$</span>{g.resource(<span class="key">dir</span>:<span class="string"><span class="delimiter">'</span><span class="content">files</span><span class="delimiter">'</span></span>, <span class="key">file</span>:<span class="string"><span class="delimiter">'</span><span class="content">mydoc.pdf</span><span class="delimiter">'</span></span>)}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Will produce a URI such as <code>/static/files/mydoc.pdf</code> instead of <code>/files/mydoc.pdf</code>. If you wish to revert to the previous behavior you can configure this in <code>application.yml</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">grails</span>:
    <span class="key">resources</span>:
        <span class="key">pattern</span>: <span class="string"><span class="content">'/**'</span></span></code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_filters_plugin_removed">Filters Plugin Removed</h4>
<div class="paragraph">
<p>The Filters plugin was replaced by <a href="theWebLayer.html#interceptors">Interceptors</a> in Grails 3.0.x, although the plugin was still present. In Grails 3.1.x the Filters plugin has been removed. If you still wish to use the filters plugin you can add a dependency on the previous version provided by Grails 3.0.x. For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">compile <span class="string"><span class="delimiter">'</span><span class="content">org.grails:grails-plugin-filters:3.0.12</span><span class="delimiter">'</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>You would also need to move the filters to any other source directory (e.g. <code>grails-app/controllers</code>) as <code>grails-app/conf</code> is not considered a source directory anymore.</p>
</div>
</div>
<div class="sect3">
<h4 id="_spring_transactional_proxies">Spring Transactional Proxies</h4>
<div class="paragraph">
<p>Because the <code>grails.transactional.Transactional</code> transform already provides the ability to create transactional services without the need for proxies, traditional support for transactional proxies has been disabled by default for new applications.</p>
</div>
<div class="paragraph">
<p>This means that if you have any services that use the <code>transactional</code> property and not the <code>Transactional</code> annotation they should be altered. For example the following service:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="type">class</span> <span class="class">FooService</span> {
    <span class="directive">static</span> transactional = <span class="predefined-constant">true</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Becomes:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="keyword">import</span> <span class="include">grails.transaction.Transactional</span>

<span class="annotation">@Transactional</span>
<span class="type">class</span> <span class="class">FooService</span> {

}</code></pre>
</div>
</div>
<div class="paragraph">
<p>In addition because in previous versions of a Grails <code>transactional</code> defaulted to <code>true</code> any services that do not declare <code>transactional</code> should be altered too.</p>
</div>
<div class="paragraph">
<p>If you wish to adopt the new behavior then transctional proxies can be disabled with the following configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="key">grails</span>:
    <span class="key">spring</span>:
        <span class="key">transactionManagement</span>:
            <span class="key">proxies</span>: <span class="predefined-constant">false</span></code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_json_converter_changes">JSON Converter changes</h4>
<div class="paragraph">
<p>The default JSON converter no longer includes the <code>class</code> property by default. This can be re-enable with the following configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">grails</span>:
    <span class="key">converters</span>:
        <span class="key">domain</span>:
            <span class="key">include</span>:
                <span class="key">class</span>: <span class="string"><span class="content">true</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>In addition the default JSON converter will no longer render the <code>id</code> property if it is <code>null</code>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_json_builder_groovy_alignment">JSON Builder Groovy Alignment</h4>
<div class="paragraph">
<p>The class <code>grails.web.JSONBuilder</code> has been deprecated and replaced with <a href="http://docs.groovy-lang.org/latest/html/gapi/groovy/json/StreamingJsonBuilder.html">groovy.json.StreamingJsonBuilder</a>, the default JSON builder within Groovy. This avoids confusion with the differences between JSON builders and better aligns with Groovy&#8217;s core libraries.</p>
</div>
<div class="paragraph">
<p>This also means that any <code>render</code> blocks that rendered JSON will need to be updated to use the <a href="http://docs.groovy-lang.org/latest/html/gapi/groovy/json/StreamingJsonBuilder.html">groovy.json.StreamingJsonBuilder</a> syntax. For example the following code:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">render(<span class="key">contentType</span>:<span class="string"><span class="delimiter">&quot;</span><span class="content">application/json</span><span class="delimiter">&quot;</span></span>) {
    title = <span class="string"><span class="delimiter">&quot;</span><span class="content">The Stand</span><span class="delimiter">&quot;</span></span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Should instead be written as:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">render(<span class="key">contentType</span>:<span class="string"><span class="delimiter">&quot;</span><span class="content">application/json</span><span class="delimiter">&quot;</span></span>) {
    title <span class="string"><span class="delimiter">&quot;</span><span class="content">The Stand</span><span class="delimiter">&quot;</span></span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>If you are upgrading and prefer to continue to use the previous implementation then you can re-enable the deprecated JSONBuilder with the following configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">grails</span>:
    <span class="key">json</span>:
        <span class="key">legacy</span>:
            <span class="key">builder</span>: <span class="string"><span class="content">true</span></span></code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_json_views_replace_json_converters">JSON Views Replace JSON Converters</h4>
<div class="paragraph">
<p>With the addition of JSON views the previous API for using JSON converters is largely discouraged in favour of views. The converters plugin will in the future be separated into an external plugin and JSON views phased in to replace it. The JSON converter API is not deprecated, however JSON views provide a more fully featured, elegant API that is superior to writing JSON converters and/or marshallers.</p>
</div>
</div>
<div class="sect3">
<h4 id="_spring_boot_1_3_and_spring_4_2">Spring Boot 1.3 and Spring 4.2</h4>
<div class="paragraph">
<p>Grails 3.1 ships with upgraded third party libraries that may require changes. See the <a href="https://github.com/spring-projects/spring-boot/wiki/spring-boot-1.3-release-notes">Spring Boot upgrade notes</a> for information.</p>
</div>
<div class="paragraph">
<p>Unlike Spring Boot 1.2, Spring Boot 1.3 no longer uses the <a href="https://docs.gradle.org/current/userguide/application_plugin.html">Gradle Application Plugin</a> so if you relied on any behavior the application plugin then the plugin will need to be re-applied to your <code>build.gradle</code>.</p>
</div>
<div class="paragraph">
<p>Spring Boot 1.3 also uses Spring Security 4.x by default, so if you project depends on Spring Security 3.x you have to force a downgrade. For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">compile <span class="string"><span class="delimiter">'</span><span class="content">org.springframework.security:spring-security-core:3.2.9.RELEASE</span><span class="delimiter">'</span></span>
compile <span class="string"><span class="delimiter">'</span><span class="content">org.springframework.security:spring-security-web:3.2.9.RELEASE</span><span class="delimiter">'</span></span></code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_gradle_run_task_no_longer_available_by_default">Gradle run task no longer available by default</h4>
<div class="paragraph">
<p>Because the Gradle <code>run</code> task for application startup was provided by the <a href="https://docs.gradle.org/current/userguide/application_plugin.html">Gradle Application Plugin</a> (see above), it is no longer available by default. If you use Gradle to start up your application, use the <code>bootRun</code> task instead, or re-apply the Application plugin in your <code>build.gradle</code>.</p>
</div>
<div class="paragraph">
<p>Note: If you don&#8217;t have need of the Gradle Application plugin&#8217;s features, but have custom Gradle tasks or IDE configurations that depend on <code>run</code>, you can supply your own <code>run</code> task that depends on <code>bootRun</code> in your <code>build.gradle</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">task run(<span class="key">dependsOn</span>: [<span class="string"><span class="delimiter">'</span><span class="content">bootRun</span><span class="delimiter">'</span></span>])</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_resource_annotation_defaults_to_json_instead_of_xml">Resource annotation defaults to JSON instead of XML</h4>
<div class="paragraph">
<p>The <a href="http://docs.grails.org/3.2.11/api/grails/rest/Resource.html">Resource</a> annotation applied to domain classes defaults to XML in Grails 3.0.x, but in Grails 3.1.x and above it defaults to JSON.</p>
</div>
<div class="paragraph">
<p>If you use this annotation with the expecation of produces XML responses as the default you can modify the definition as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="keyword">import</span> <span class="include">grails.rest.*</span>

<span class="annotation">@Resource</span>(formats=[<span class="string"><span class="delimiter">'</span><span class="content">xml</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">json</span><span class="delimiter">'</span></span>])
<span class="type">class</span> <span class="class">MyDomainClass</span> {}</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will restore the Grails 3.0.x behavior.</p>
</div>
</div>
<div class="sect3">
<h4 id="_geb_and_htmlunit_2_18">Geb and HTMLUnit 2.18</h4>
<div class="paragraph">
<p>If you use Geb with HTMLUnit (something that is not recommended, as a more native driver such as PhantomJS is recommended) you will need to upgrade your dependencies in <code>build.grade</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">testRuntimeOnly <span class="string"><span class="delimiter">'</span><span class="content">org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1</span><span class="delimiter">'</span></span>
    testRuntimeOnly <span class="string"><span class="delimiter">'</span><span class="content">net.sourceforge.htmlunit:htmlunit:2.18</span><span class="delimiter">'</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that there are also some changes in behavior in HTMLUnit 2.18 that may cause issues in existing tests including:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Expressions that evaluate the title (Example <code>$('title')</code>) now return blank and should be replaced with just <code>title</code></p>
</li>
<li>
<p>If you return plain text in a response without surrounding HTML tags, these are no longer regarded as valid responses and should be wrapped in the required tags.</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="__code_application_groovy_code_changes_3_1_11"><code>application.groovy</code> Changes (3.1.11+)</h4>
<div class="paragraph">
<p>An improvement was added to make groovy configuration behave like yml configuration when it comes to the CLI. Previously, configuration values in <code>application.groovy</code> were not available to commands like <code>grails create-controller</code>. A side effect of this change causes an exception when those commands are executed if the configuration relies on classes in the runtime.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="exception">Error</span> occurred running Grails <span class="key">CLI</span>: startup <span class="key">failed</span>:
script14738267015581837265078.groovy: <span class="integer">13</span>: unable to resolve <span class="type">class</span> <span class="class">com</span>.foo.Bar</code></pre>
</div>
</div>
<div class="paragraph">
<p>The solution is to create a separate file called <code>runtime.groovy</code> in <code>grails-app/conf</code>. That file will not be parsed by the CLI and will only be included at runtime.</p>
</div>
</div>


<h2 id="upgrading2x">3.4 Upgrading from Grails 2.x</h2>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading/upgrading2x.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>This guide takes you through the fundamentals of upgrading a Grails 2.x application or plugins to Grails 3.x.</p>
</div>


<h2 id="upgradingPlugins">3.4.1 Upgrading Plugins</h2>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading/upgrading2x/upgradingPlugins.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>To upgrade a Grails 2.x plugin to Grails 3.x you need to make a number of different changes. This documentation will outline the steps that were taken to upgrade the Quartz plugin to Grails 3, each individual plugin may differ.</p>
</div>
<div class="sect3">
<h4 id="_step_1_create_a_new_grails_3_plugin">Step 1 - Create a new Grails 3 plugin</h4>
<div class="paragraph">
<p>The first step is to create a new Grails 3 plugin using the command line:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">$ grails create-plugin quartz</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will create a Grails 3 plugin in the <code>quartz</code> directory.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_2_copy_sources_from_the_original_grails_2_plugin">Step 2 - Copy sources from the original Grails 2 plugin</h4>
<div class="paragraph">
<p>The next step is to copy the sources from the original Grails 2 plugin to the Grails 3 plugin:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash"># first the sources
cp -rf ../quartz-2.x/src/groovy/ src/main/groovy
cp -rf ../quartz-2.x/src/java/ src/main/groovy
cp -rf ../quartz-2.x/grails-app/ grails-app
cp -rf ../quartz-2.x/QuartzGrailsPlugin.groovy src/main/groovy/grails/plugins/quartz

# then the tests
cp -rf ../quartz-2.x/test/unit/* src/test/groovy
mkdir -p src/integration-test/groovy
cp -rf ../quartz-2.x/test/integration/* src/integration-test/groovy

# then templates / other resources
cp -rf ../quartz-2.x/src/templates/ src/main/templates</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_step_3_alter_the_plugin_descriptor">Step 3 - Alter the plugin descriptor</h4>
<div class="paragraph">
<p>You will need to add a package declaration to the plugin descriptor. In this case <code>QuartzGrailsPlugin</code> is modified as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="comment">// add package declaration</span>
<span class="keyword">package</span> grails.plugins.quartz
...
class QuartzGrailsPlugin <span class="directive">extends</span> Plugin {
 ...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>In addition you should remove the <code>version</code> property from the descriptor as this is now defined in <code>build.gradle</code>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_4_update_the_gradle_build_with_required_dependencies">Step 4 - Update the Gradle build with required dependencies</h4>
<div class="paragraph">
<p>The repositories and dependencies defined in <code>grails-app/conf/BuildConfig.groovy</code> of the original Grails 2.x plugin will need to be defined in <code>build.gradle</code> of the new Grails 3.x plugin:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">compile(<span class="string"><span class="delimiter">&quot;</span><span class="content">org.quartz-scheduler:quartz:2.2.1</span><span class="delimiter">&quot;</span></span>) {
    exclude <span class="key">group</span>: <span class="string"><span class="delimiter">'</span><span class="content">slf4j-api</span><span class="delimiter">'</span></span>, <span class="key">module</span>: <span class="string"><span class="delimiter">'</span><span class="content">c3p0</span><span class="delimiter">'</span></span>
  }</code></pre>
</div>
</div>
<div class="paragraph">
<p>It is recommended to use the latest stable, Grails 3+ compatible version of plugins. (Grails 2.x plugin versions will not work.)</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_5_modify_package_imports">Step 5 - Modify Package Imports</h4>
<div class="paragraph">
<p>In Grails 3.x all internal APIs can be found in the <code>org.grails</code> package and public facing APIs in the <code>grails</code> package. The <code>org.codehaus.groovy.grails</code> package no longer exists.</p>
</div>
<div class="paragraph">
<p>All package declaration in sources should be modified for the new location of the respective classes. Example <code>org.codehaus.groovy.grails.commons.GrailsApplication</code> is now <code>grails.core.GrailsApplication</code>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_5_migrate_plugin_specific_config_to_application_yml">Step 5 - Migrate Plugin Specific Config to application.yml</h4>
<div class="paragraph">
<p>Some plugins define a default configuration file. For example the Quartz plugin defines a file called <code>grails-app/conf/DefaultQuartzConfig.groovy</code>. In Grails 3.x this default configuration can be migrated to <code>grails-app/conf/application.yml</code> and it will automatically be loaded by Grails without requiring manual configuration merging.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_6_update_plugin_exclusions">Step 6 - Update plugin exclusions</h4>
<div class="paragraph">
<p>Old plugins may have a <code>pluginExcludes</code> property defined that lists the patterns for any files that should not be included in the plugin package. This is normally used to exclude artifacts such as domain classes that are used in the plugin&#8217;s integration tests. You generally don&#8217;t want these polluting the target application.</p>
</div>
<div class="paragraph">
<p>This property is no longer sufficient in Grails 3, and nor can you use source paths. Instead, you must specify patterns that match the paths of the compiled classes. For example, imagine you have some test domain classes in the <code>grails-app/domain/plugin/tests</code> directory. You should first change the <code>pluginExcludes</code> value to</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="keyword">def</span> pluginExcludes = [<span class="string"><span class="delimiter">&quot;</span><span class="content">plugin/test/**</span><span class="delimiter">&quot;</span></span>]</code></pre>
</div>
</div>
<div class="paragraph">
<p>and then add this block to the build file:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">jar {
    exclude <span class="string"><span class="delimiter">&quot;</span><span class="content">plugin/test/**</span><span class="delimiter">&quot;</span></span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The easiest way to ensure these patterns work effectively is to put all your non-packaged class into a distinct Java package so that there is a clean separation between the main plugin classes and the rest.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_7_register_artefacthandler_definitions">Step 7 - Register ArtefactHandler Definitions</h4>
<div class="paragraph">
<p>In Grails 3.x <a href="http://docs.grails.org/3.2.11/api/grails/core/ArtefactHandler.html">ArtefactHandler</a> definitions written in Java need to be declared in a file called <code>src/main/resources/META-INF/grails.factories</code> since these need to be known at compile time.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If the <code>ArtefactHandler</code> is written in Groovy this step can be skipped as Grails will automatically create the <code>grails.factories</code> file during compilation.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The Quartz plugin requires the following definition to register the <code>ArtrefactHandler</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">grails.core.ArtefactHandler=grails.plugins.quartz.JobArtefactHandler</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_step_8_migrate_code_generation_scripts">Step 8 - Migrate Code Generation Scripts</h4>
<div class="paragraph">
<p>Many plugins previously defined command line scripts in Gant. In Grails 3.x command line scripts have been replaced by two new features: Code generation scripts and Gradle tasks.</p>
</div>
<div class="paragraph">
<p>If your script is doing simple code generation then for many cases a code generation script can replace an old Gant script.</p>
</div>
<div class="paragraph">
<p>The <code>create-job</code> script provided by the Quartz plugin in Grails 2.x was defined in <code>scripts/CreateJob.groovy</code> as:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">includeTargets &lt;&lt; grailsScript(<span class="string"><span class="delimiter">&quot;</span><span class="content">_GrailsCreateArtifacts</span><span class="delimiter">&quot;</span></span>)

target(<span class="key">createJob</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Creates a new Quartz scheduled job</span><span class="delimiter">&quot;</span></span>) {
    depends(checkVersion, parseArguments)

    <span class="keyword">def</span> type = <span class="string"><span class="delimiter">&quot;</span><span class="content">Job</span><span class="delimiter">&quot;</span></span>
    promptForName(<span class="key">type</span>: type)

    <span class="keyword">for</span> (name <span class="keyword">in</span> argsMap.params) {
        name = purgeRedundantArtifactSuffix(name, type)
        createArtifact(<span class="key">name</span>: name, <span class="key">suffix</span>: type, <span class="key">type</span>: type, <span class="key">path</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">grails-app/jobs</span><span class="delimiter">&quot;</span></span>)
        createUnitTest(<span class="key">name</span>: name, <span class="key">suffix</span>: type)
    }
}

setDefaultTarget <span class="string"><span class="delimiter">'</span><span class="content">createJob</span><span class="delimiter">'</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>A replacement Grails 3.x compatible script can be created using the <code>create-script</code> command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">$ grails create-script create-job</code></pre>
</div>
</div>
<div class="paragraph">
<p>Which creates a new script called <code>src/main/scripts/create-job.groovy</code>. Using the new code generation API it is simple to implement:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">description(<span class="string"><span class="delimiter">&quot;</span><span class="content">Creates a new Quartz scheduled job</span><span class="delimiter">&quot;</span></span>) {
    usage <span class="string"><span class="delimiter">&quot;</span><span class="content">grails create-job &lt;&lt;JOB NAME&gt;&gt;</span><span class="delimiter">&quot;</span></span>
    argument <span class="key">name</span>:<span class="string"><span class="delimiter">'</span><span class="content">Job Name</span><span class="delimiter">'</span></span>, <span class="key">description</span>:<span class="string"><span class="delimiter">&quot;</span><span class="content">The name of the job</span><span class="delimiter">&quot;</span></span>
}

model = model( args[<span class="integer">0</span>] )
render  <span class="key">template</span>:<span class="string"><span class="delimiter">&quot;</span><span class="content">Job.groovy</span><span class="delimiter">&quot;</span></span>,
        <span class="key">destination</span>: file( <span class="string"><span class="delimiter">&quot;</span><span class="content">grails-app/jobs/</span><span class="inline"><span class="inline-delimiter">$</span>model</span><span class="content">.packagePath/</span><span class="inline"><span class="inline-delimiter">${</span>model.simpleName<span class="inline-delimiter">}</span></span><span class="content">Job.groovy</span><span class="delimiter">&quot;</span></span>),
        <span class="key">model</span>: model</code></pre>
</div>
</div>
<div class="paragraph">
<p>Please refer to the documentation on <a href="commandLine.html#creatingCustomScripts">Creating Custom Scripts</a> for more information.</p>
</div>
</div>
<div class="sect3">
<h4 id="_migrating_more_complex_scripts_using_gradle_tasks">Migrating More Complex Scripts Using Gradle Tasks</h4>
<div class="paragraph">
<p>Using the old Grails 2.x build system it was relatively common to spin up Grails inside the command line. In Grails 3.x it is not possible to load a Grails application within a code generation script created by the <a href="../ref/Command%20Line/create-script.html">create-script</a> command.</p>
</div>
<div class="paragraph">
<p>Instead a new mechanism specific to plugins exists via the <a href="../ref/Command%20Line/create-command.html">create-command</a> command. The <code>create-command</code> command will create a new <a href="http://docs.grails.org/3.2.11/api/grails/dev/commands/ApplicationCommand.html">ApplicationCommand</a>, for example the following command will execute a query:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="keyword">import</span> <span class="include">grails.dev.commands.*</span>
<span class="keyword">import</span> <span class="include">javax.sql.*</span>
<span class="keyword">import</span> <span class="include">groovy.sql.*</span>
<span class="keyword">import</span> <span class="include">org.springframework.beans.factory.annotation.*</span>

<span class="type">class</span> <span class="class">RunQueryCommand</span> <span class="directive">implements</span> ApplicationCommand {

  <span class="annotation">@Autowired</span>
  <span class="predefined-type">DataSource</span> dataSource

  <span class="type">boolean</span> handle(ExecutionContext ctx) {
      <span class="keyword">def</span> sql = <span class="keyword">new</span> Sql(dataSource)
      println sql.executeQuery(<span class="string"><span class="delimiter">&quot;</span><span class="content">select * from foo</span><span class="delimiter">&quot;</span></span>)
      <span class="keyword">return</span> <span class="predefined-constant">true</span>
  }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>With this command in place once the plugin is installed into your local Maven cache you can add the plugin to both the build classpath and the runtime classpath of the application&#8217;s <code>build.gradle</code> file:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">buildscript {
  ...
  dependencies {
    classpath <span class="string"><span class="delimiter">&quot;</span><span class="content">org.grails.plugins:myplugin:0.1-SNAPSHOT</span><span class="delimiter">&quot;</span></span>
  }
}
...
dependencies {
  runtime <span class="string"><span class="delimiter">&quot;</span><span class="content">org.grails.plugins:myplugin:0.1-SNAPSHOT</span><span class="delimiter">&quot;</span></span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Grails will automatically create a Gradle task called <code>runQuery</code> and a command named <code>run-query</code> so both the following examples will execute the command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">$ grails run-query
$ gradle runQuery</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_step_8_delete_files_that_were_migrated_or_no_longer_used">Step 8 - Delete Files that were migrated or no longer used</h4>
<div class="paragraph">
<p>You should now delete and cleanup the project of any files no longer required by Grails 3.x (<code>BuildConfig.groovy</code>, <code>Config.groovy</code>, <code>DataSource.groovy</code> etc.)</p>
</div>
</div>


<h2 id="upgradingApps">3.4.2 Upgrading Applications</h2>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading/upgrading2x/upgradingApps.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>Upgrading applications to Grails 3.x will require that you upgrade all plugins the application uses first, hence you should follow the steps in the previous section to first upgrade your plugins.</p>
</div>
<div class="sect3">
<h4 id="_step_1_create_a_new_application">Step 1 - Create a New Application</h4>
<div class="paragraph">
<p>Once the plugins are Grails 3.x compatible you can upgrade the application. To upgrade an application it is again best to create a new Grails 3 application using the "web" profile:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">$ grails create-app myapp
$ cd myapp</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_step_2_migrate_sources">Step 2 - Migrate Sources</h4>
<div class="paragraph">
<p>The next step is to copy the sources from the original Grails 2 application to the Grails 3 application:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash"># first the sources
cp -rf ../old_app/src/groovy/ src/main/groovy
cp -rf ../old_app/src/java/ src/main/groovy
cp -rf ../old_app/grails-app/ grails-app

# then the tests
cp -rf ../old_app/test/unit/ src/test/groovy
mkdir -p src/integration-test/groovy
cp -rf ../old_app/test/integration/ src/integration-test/groovy</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_step_3_update_the_gradle_build_with_required_dependencies">Step 3 - Update the Gradle build with required dependencies</h4>
<div class="paragraph">
<p>The repositories and dependencies defined in <code>grails-app/conf/BuildConfig.groovy</code> of the original Grails 2.x application will need to be defined in <code>build.gradle</code> of the new Grails 3.x application.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_4_modify_package_imports">Step 4 - Modify Package Imports</h4>
<div class="paragraph">
<p>In Grails 3.x all internal APIs can be found in the <code>org.grails</code> package and public facing APIs in the <code>grails</code> package. The <code>org.codehaus.groovy.grails</code> package no longer exists.</p>
</div>
<div class="paragraph">
<p>All package declaration in sources should be modified for the new location of the respective classes. Example <code>org.codehaus.groovy.grails.commons.GrailsApplication</code> is now <code>grails.core.GrailsApplication</code>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_5_migrate_configuration">Step 5 - Migrate Configuration</h4>
<div class="paragraph">
<p>The configuration of the application will need to be migrated, this can normally be done by simply renaming <code>grails-app/conf/Config.groovy</code> to <code>grails-app/conf/application.groovy</code> and merging the content of <code>grails-app/conf/DataSource.groovy</code> into <code>grails-app/conf/application.groovy</code>.</p>
</div>
<div class="paragraph">
<p>Note however that Log4j has been replaced by <code>grails-app/conf/logback.groovy</code> for logging, so any logging configuration in <code>grails-app/conf/Config.groovy</code> should be migrated to <a href="http://logback.qos.ch/manual/groovy.html">logback format</a>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_6_migrate_web_xml_modifications_to_spring">Step 6 - Migrate web.xml Modifications to Spring</h4>
<div class="paragraph">
<p>If you have a modified <code>web.xml</code> template then you will need to migrate this to Spring as Grails 3.x does not use a web.xml (although it is still possible to have on in <code>src/main/webapp/WEB-INF/web.xml</code>).</p>
</div>
<div class="paragraph">
<p>New servlets and filters can be registered as Spring beans or with <a href="http://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/embedded/ServletRegistrationBean.html">ServletRegistrationBean</a> and <a href="http://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/embedded/FilterRegistrationBean.html">FilterRegistrationBean</a> respectively.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_7_migrate_static_assets_not_handled_by_asset_pipeline">Step 7 - Migrate Static Assets not handled by Asset Pipeline</h4>
<div class="paragraph">
<p>If you have static assets in your <code>web-app</code> directory of your Grails 2.x application such as HTML files, TLDs etc. these need to be moved. For public assets such as static HTML pages and so on these should go in <code>src/main/resources/public</code>.</p>
</div>
<div class="paragraph">
<p>TLD descriptors and non public assets should go in <code>src/main/resources/WEB-INF</code>.</p>
</div>
<div class="paragraph">
<p>As noted earlier, <code>src/main/webapp</code> folder can also be used for this purpose but it is not recommended.</p>
</div>
</div>
<div class="sect3">
<h4 id="_step_8_migrate_tests">Step 8 - Migrate Tests</h4>
<div class="paragraph">
<p>Once the package names are corrected unit tests will continue to run, however any tests that extend the deprecated and removed JUnit 3 hierarchy will need to be migrated to Spock or JUnit 4.</p>
</div>
<div class="paragraph">
<p>Integration tests will need to be annotated with the <a href="http://docs.grails.org/3.2.11/api/grails/test/mixin/integration/Integration.html">Integration</a> annotation and should not extend GroovyTestCase or any JUnit 3 super class.</p>
</div>
</div>


<h2 id="upgradingGeneral">3.4.3 General Changes to be aware of when migrating apps</h2>

<div class='contribute-btn'>
    <button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/3.2.x/src/en/guide/upgrading/upgrading2x/upgradingGeneral.adoc"'>
        <i class='fa fa-pencil-square-o'></i> Improve this doc
    </button>
</div>


<div class="paragraph">
<p>There are other miscellaneous changes between Grails 2.x and Grails 3.x that it may help to be aware of when migrating your applications and plugins. Minor changes may be required.</p>
</div>
<div class="sect3">
<h4 id="_domain_classes">Domain classes</h4>
<div class="paragraph">
<p>The <a href="#constraints">Constraints</a> section of a <a href="#GORM">Domain Class</a> (or other validateable object) looks like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="directive">static</span> constraints = {
  name <span class="key">nullable</span>: <span class="predefined-constant">true</span>, <span class="key">blank</span>: <span class="predefined-constant">false</span>
  myField <span class="key">nullable</span>: <span class="predefined-constant">true</span>
  another <span class="key">unique</span>: <span class="predefined-constant">true</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>In Grails 2.x, fields with no constraints could be declared in the <a href="#constraints">Constraints</a> block, as a method call with no arguments. Example (NB. the following syntax is <strong>no longer</strong> supported):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="directive">static</span> constraints = {
  name <span class="key">nullable</span>: <span class="predefined-constant">true</span>, <span class="key">blank</span>: <span class="predefined-constant">false</span>
  mySimpleProperty()                  <span class="comment">// &lt;- A field that has no constraints. This syntax is not supported in Grails 3.</span>
  anotherProperty <span class="key">unique</span>: <span class="predefined-constant">true</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>A different syntax has to be used in Grails 3. Either remove the field declaration from the constraints block (if there are no constraints to specify for it), or to keep the field placeholder, pass an empty map argument: <code>\[:\]</code> instead of <code>()</code>.</p>
</div>
<div class="paragraph">
<p>Replacement code for Grails 3.x:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="directive">static</span> constraints = {
  name <span class="key">nullable</span>: <span class="predefined-constant">true</span>, <span class="key">blank</span>: <span class="predefined-constant">false</span>
  mySimpleProperty [:]                <span class="comment">// &lt;- Empty map argument instead of ()</span>
  anotherProperty <span class="key">unique</span>: <span class="predefined-constant">true</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>If such declarations have not yet been changed then a log message like this emits on startup:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">ORM Mapping <span class="key">Invalid</span>: Specified config option &lt;&lt;mySimpleProperty&gt;&gt; does not exist <span class="keyword">for</span> <span class="type">class</span> [<span class="class">example</span>.MyDomainClass]</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_multi_project_builds_grails_2_x_inline_plugins">Multi-project builds (Grails 2.x inline plugins)</h4>
<div class="paragraph">
<p>If your project had inline plugins in Grails 2.x, contains ASTs, or if your project is composed of several modules or related applications then you may decide to restructure your project as a Gradle <strong>multi-project build</strong>.</p>
</div>
<div class="paragraph">
<p>Sample multi-project structure:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java">+ example
    + example-app   &lt;-- Main app
    + example-core  &lt;-- Shared code plugin
    + example-ast   &lt;-- AST transformations plugin</code></pre>
</div>
</div>
<div class="paragraph">
<p>How to configure this is documented in the <a href="#plugins">Plugins</a> section under the heading 'Inline Plugins in Grails 3.0'.</p>
</div>
</div>
<div class="sect3">
<h4 id="_migrating_from_grails_2_x_to_grails_3_1">Migrating from Grails 2.x to Grails 3.1+</h4>
<div class="paragraph">
<p>During the progress of migrating code from Grails 2.4 to Grails 3.1+, your project (and the plugins that your project depends on) will be moving to GORM 5 (or higher) and other newer library versions. You might also wish to familiarise yourself with the differences mentioned in the section <a href="#upgrading3x">Upgrading from Grails 3.0</a>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_ast_transformations">AST Transformations</h4>
<div class="paragraph">
<p>If your application contains AST transformations, please be aware that for these to be applied to your application code, they must now be contained <strong>within a plugin</strong>. (In Grails 2.x it was possible to pre-compile AST transformations then apply them to your application code by hooking into compile events in <code>_Events.groovy</code>. This is no longer possible. Move your AST Transformation classes and associated annotations into a plugin for this purpose.)</p>
</div>
<div class="paragraph">
<p>There are two AST patterns on which you can base migration of your AST transformer code:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Groovy way: Use Groovy AST transformation annotations.</p>
</li>
<li>
<p>Grails way: Use Grails AST transformer annotations.</p>
</li>
</ul>
</div>
<div class="sect4">
<h5 id="_groovy_ast_transformations">Groovy AST transformations</h5>
<div class="ulist">
<ul>
<li>
<p>Import <code>org.codehaus.groovy.transform.GroovyASTTransformation</code></p>
</li>
<li>
<p>Annotate your transformation class with <code>GroovyASTTransformation(phase=CompilePhase.CANONICALIZATION)</code></p>
</li>
<li>
<p>A useful example app can be found here: <a href="#ref-comjeffbrowngrails3ast-grails3ast">grails3ast</a></p>
</li>
</ul>
</div>
</div>
<div class="sect4">
<h5 id="_grails_ast_transformations">Grails AST transformations</h5>
<div class="ulist">
<ul>
<li>
<p>Import <code>grails.compiler.ast.AstTransformer</code></p>
</li>
<li>
<p>Annotate your transformation class with <code>AstTransformer</code></p>
</li>
<li>
<p>Implement applicable interfaces, particularly if you are transforming Artefacts, e.g. <code>implements GrailsArtefactClassInjector, AnnotatedClassInjector</code></p>
</li>
<li>
<p>Your Transformer class must reside in a package under <strong>org.grails.compiler</strong>, otherwise it will not be detected. Example: <strong>org.grails.compiler.myapp</strong></p>
</li>
<li>
<p>Examples can be found in the Grails source code</p>
</li>
<li>
<p>Example reference: <a href="#ref-java-ControllerActionTransformer.java">ControllerActionTransformer.java</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_deployment_to_containers">Deployment to containers</h4>
<div class="paragraph">
<p>Grails uses Spring Boot to embed a Tomcat or Jetty instance by default. To build a war file for deployment to a container you will need to make a simple change to <code>build.gradle</code> (so that a container is not embedded).</p>
</div>
<div class="paragraph">
<p>If you deploy to a Tomcat 7 container then there is an additional step. Grails 3 is built against Tomcat 8 APIs by default. You will need to change the target Tomcat version in the build to 7.</p>
</div>
<div class="paragraph">
<p>There are standalone deployment options available.</p>
</div>
<div class="paragraph">
<p>Refer to the <a href="#deployingAnApplication">Deployment guide</a> for further details.</p>
</div>
</div>
<div class="sect3">
<h4 id="_multiple_datasources">Multiple datasources</h4>
<div class="paragraph">
<p>If your application uses multiple datasources, then be aware that the way these are declared in <code>application.yml</code> or <code>application.groovy</code> (previously <code>DataSources.groovy</code>) has changed.</p>
</div>
<div class="paragraph">
<p>If there is more than one DataSource in an application there is now a <code>dataSources { &#8230;&#8203; }</code> configuration block to contain them all. Previously, multiple <code>dataSource</code> declarations were used, with an underscore and suffix on the additional datasources, e.g. <code>dataSource_lookup { &#8230;&#8203; }</code>.</p>
</div>
<div class="paragraph">
<p>Please refer to the user guide section on <a href="#multipleDatasources">Multiple Datasources</a> for examples.</p>
</div>
</div>
<div class="sect3">
<h4 id="_improvements_to_dependency_injection">Improvements to dependency injection</h4>
<div class="paragraph">
<p>In your Grails 2.x app you may have used Spring <code>@Autowired</code> in a few situations, such as dependency injection into certain base classes, and for typed field dependency injection. For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="annotation">@Autowired</span>
org.quartz.Scheduler quartzScheduler</code></pre>
</div>
</div>
<div class="paragraph">
<p>Grails now has support for dependency injection into typed fields in addition to untyped <code>def</code> fields, following the usual Grails conventions of field name matching the bean property name. Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">GrailsApplication grailsApplication</code></pre>
</div>
</div>
<div class="paragraph">
<p>You may find that <code>@Autowired</code> no longer works as it did previously in your code on artefacts or base classes, in certain scenarios, resulting in NULL for these fields. Changing these to a simple typed Grails dependency following the Grails naming convention and removing <code>@Autowired</code> should resolve this.</p>
</div>
</div>


                <div style="clear:both;margin-top:15px;"></div>
                
                    <div class="toc-item prev-left"><a href="../guide/gettingStarted.html">&lt;&lt; <strong>2</strong><span>Getting Started</span></a></div>
                
                    <div class="toc-item next-right"><a href="../guide/conf.html"><strong>4</strong><span>Configuration</span> >></a></div>
                
                <div style="clear:both"></div>
            </div>
        </td>
        <td id="col2">
            <div class="local clearfix">
                <div class="local-title">
                    <a href="../guide/index.html" target="mainFrame">Quick Reference</a>
                    <span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
                </div>
                <div class="menu">
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Command Line</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Command%20Line/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/bug-report.html">bug-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/clean.html">clean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/compile.html">compile</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/console.html">console</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-app.html">create-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-command.html">create-command</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-controller.html">create-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-domain-class.html">create-domain-class</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-functional-test.html">create-functional-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-hibernate-cfg-xml.html">create-hibernate-cfg-xml</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-integration-test.html">create-integration-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-interceptor.html">create-interceptor</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-plugin.html">create-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-profile.html">create-profile</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-script.html">create-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-service.html">create-service</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-taglib.html">create-taglib</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-unit-test.html">create-unit-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/dependency-report.html">dependency-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/docs.html">docs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/generate-all.html">generate-all</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/generate-controller.html">generate-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/generate-views.html">generate-views</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/help.html">help</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/install-templates.html">install-templates</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/list-plugins.html">list-plugins</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/list-profiles.html">list-profiles</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/package-plugin.html">package-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/package.html">package</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/plugin-info.html">plugin-info</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/profile-info.html">profile-info</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/run-app.html">run-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/run-command.html">run-command</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/run-script.html">run-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/schema-export.html">schema-export</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/shell.html">shell</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/stats.html">stats</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/stop-app.html">stop-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/test-app.html">test-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/war.html">war</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Constraints</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Constraints/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Constraints/attributes.html">attributes</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/bindable.html">bindable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/blank.html">blank</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/creditCard.html">creditCard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/email.html">email</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/inList.html">inList</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/matches.html">matches</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/max.html">max</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/maxSize.html">maxSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/min.html">min</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/minSize.html">minSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/notEqual.html">notEqual</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/nullable.html">nullable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/range.html">range</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/scale.html">scale</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/size.html">size</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/unique.html">unique</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/url.html">url</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/validator.html">validator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/widget.html">widget</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Controllers</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Controllers/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Controllers/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/allowedMethods.html">allowedMethods</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/bindData.html">bindData</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/chain.html">chain</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/defaultAction.html">defaultAction</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/errors.html">errors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/forward.html">forward</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/grailsApplication.html">grailsApplication</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/namespace.html">namespace</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/redirect.html">redirect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/respond.html">respond</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/responseFormats.html">responseFormats</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/scope.html">scope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/session.html">session</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/withForm.html">withForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/withFormat.html">withFormat</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Database Mapping</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Database%20Mapping/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/autoImport.html">autoImport</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/autoTimestamp.html">autoTimestamp</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/batchSize.html">batchSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/cache.html">cache</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/cascade.html">cascade</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/column.html">column</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/comment.html">comment</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/discriminator.html">discriminator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/dynamicInsert.html">dynamicInsert</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/dynamicUpdate.html">dynamicUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/fetch.html">fetch</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/id.html">id</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/ignoreNotFound.html">ignoreNotFound</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/indexColumn.html">indexColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/insertable.html">insertable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/joinTable.html">joinTable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/lazy.html">lazy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/order.html">order</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/sort.html">sort</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/table.html">table</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/type.html">type</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/updateable.html">updateable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/version.html">version</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Domain Classes</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Domain%20Classes/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/addTo.html">addTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/attach.html">attach</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/belongsTo.html">belongsTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/clearErrors.html">clearErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/constraints.html">constraints</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/count.html">count</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/countBy.html">countBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/createCriteria.html">createCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/delete.html">delete</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/discard.html">discard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/embedded.html">embedded</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/errors.html">errors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/executeQuery.html">executeQuery</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/executeUpdate.html">executeUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/exists.html">exists</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/fetchMode.html">fetchMode</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/find.html">find</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findAllBy.html">findAllBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findAllWhere.html">findAllWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findBy.html">findBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrCreateBy.html">findOrCreateBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrCreateWhere.html">findOrCreateWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrSaveBy.html">findOrSaveBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrSaveWhere.html">findOrSaveWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findWhere.html">findWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/first.html">first</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/get.html">get</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/getAll.html">getAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/getDirtyPropertyNames.html">getDirtyPropertyNames</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/getPersistentValue.html">getPersistentValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/hasMany.html">hasMany</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/hasOne.html">hasOne</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/ident.html">ident</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/instanceOf.html">instanceOf</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/isAttached.html">isAttached</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/isDirty.html">isDirty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/last.html">last</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/list.html">list</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/listOrderBy.html">listOrderBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/load.html">load</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/lock.html">lock</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/mapWith.html">mapWith</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/mappedBy.html">mappedBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/mapping.html">mapping</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/merge.html">merge</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/namedQueries.html">namedQueries</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/properties.html">properties</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/read.html">read</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/refresh.html">refresh</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/removeFrom.html">removeFrom</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/save.html">save</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/transients.html">transients</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/validate.html">validate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/where.html">where</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/whereAny.html">whereAny</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withCriteria.html">withCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withNewSession.html">withNewSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withSession.html">withSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withTransaction.html">withTransaction</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Plug-ins</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Plug-ins/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/URL%20mappings.html">URL mappings</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/codecs.html">codecs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/controllers.html">controllers</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/core.html">core</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/dataSource.html">dataSource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/domainClasses.html">domainClasses</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/hibernate.html">hibernate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/i18n.html">i18n</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/logging.html">logging</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/scaffolding.html">scaffolding</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/services.html">services</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/servlets.html">servlets</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Services</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Services/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Services/scope.html">scope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Services/transactional.html">transactional</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Servlet API</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tag Libraries</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/pageScope.html">pageScope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tags</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../ref/Tags/actionSubmit.html">actionSubmit</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/actionSubmitImage.html">actionSubmitImage</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/applyLayout.html">applyLayout</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/checkBox.html">checkBox</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/collect.html">collect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/cookie.html">cookie</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/country.html">country</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/countrySelect.html">countrySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/createLink.html">createLink</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/createLinkTo.html">createLinkTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/currencySelect.html">currencySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/datePicker.html">datePicker</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/each.html">each</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/eachError.html">eachError</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/else.html">else</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/elseif.html">elseif</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/external.html">external</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/field.html">field</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/fieldError.html">fieldError</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/fieldValue.html">fieldValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/form.html">form</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/formatBoolean.html">formatBoolean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/formatDate.html">formatDate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/formatNumber.html">formatNumber</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/grep.html">grep</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/header.html">header</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/hiddenField.html">hiddenField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/if.html">if</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/img.html">img</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/include.html">include</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/isAvailable.html">isAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/isNotAvailable.html">isNotAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/javascript.html">javascript</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/join.html">join</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/layoutBody.html">layoutBody</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/layoutHead.html">layoutHead</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/layoutTitle.html">layoutTitle</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/link.html">link</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/localeSelect.html">localeSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/message.html">message</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/meta.html">meta</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/pageProperty.html">pageProperty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/paginate.html">paginate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/passwordField.html">passwordField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/radio.html">radio</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/radioGroup.html">radioGroup</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/renderErrors.html">renderErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/resource.html">resource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/select.html">select</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/set.html">set</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/sortableColumn.html">sortableColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/submitButton.html">submitButton</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/textArea.html">textArea</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/textField.html">textField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/timeZoneSelect.html">timeZoneSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/unless.html">unless</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/uploadForm.html">uploadForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/while.html">while</a>
                            </div>
                            
                            </div>
                    </div>
                    
                </div>
            </div>
        </td>
    </tr>
</table>

<div id="footer">
    Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
    
</div>

<script type="text/javascript" src="../js/docs.js"></script>

</body>
</html>
